<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>View Sent Files</title>
	<f:metadata>
		  <f:viewParam name="init" value="#{sentBean.viewParameterInit}"/>
		  <f:event listener="#{sentBean.initDynamicView}" type="preRenderView" />
	</f:metadata>
	

</h:head>
<h:body>

	<h:form id="mainForm">
	
		<p:messages id="messages" showDetail="true" autoUpdate="true" />
	
		<h:outputText value="Search and View Sent Files" style="margin-left:10px;font-weight:bold;color:#19588C"/>

		<br/>
		

		<p:separator style="margin-left:10px;"/>

		<br/>
		<p:outputPanel id="searchFieldsPanel"/>
		<br/>

		<p:commandButton value="Search Records" action="#{sentBean.fetchSentFiles}" update="mainForm" style="margin-left:10px;"/>
		<p:commandButton value="Reset All"  action="#{sentBean.resetAll}" onclick="filesDataTableWidget.clearFilters()"  update="mainForm" style="margin-left:10px;"/>
		<p:commandButton value="Clear All Filters" type="button" onclick="filesDataTableWidget.clearFilters()"  update="mainForm" style="margin-left:10px;"/>

		<p:commandButton value="" type="button"  style="margin-left:30px;margin-right:30px;" disabled="true"/>

		<p:commandButton value="Downoad Selected Files"  onclick="PF('statusDialog').show()" update="mainForm" oncomplete="PF('statusDialog').hide()"  icon="ui-icon-arrowthick-1-s" style="margin-left:0px;" action="#{sentBean.downloadSelectedFiles}"/>
		<p:commandButton value="Clear all Selections" action="#{sentBean.clearAllSelections}"  update="mainForm" style="margin-left:10px;"/>


  	    <br/><br/>
  	    
  	    <p:outputPanel  id="outputPanel"/>
  	    
  	    <br/>
  	    <h:panelGroup style="float:left;">

  	    <h:commandLink>  
            <p:graphicImage value="/images/excel.png" />  
            <p:dataExporter type="xls" target="filesDataTable" fileName="sentFiles" pageOnly="true"/>  
        </h:commandLink>  
  	    
  	    <h:commandLink>  
            <p:graphicImage value="/images/pdf.png" />  
            <p:dataExporter type="pdf" target="filesDataTable" fileName="sentFiles" pageOnly="true"/>  
        </h:commandLink>  
          
        <h:commandLink>  
            <p:graphicImage value="/images/csv.png" />  
            <p:dataExporter type="csv" target="filesDataTable" fileName="sentFiles" pageOnly="true"/>  
        </h:commandLink>  
          
        <h:commandLink>  
            <p:graphicImage value="/images/xml.png" />  
            <p:dataExporter type="xml" target="filesDataTable" fileName="sentFiles" pageOnly="true"/>  
        </h:commandLink>  
    </h:panelGroup>  
	<br/> <br/>	  
	</h:form>

	<h:form id="detailsForm">
	<p:dialog id="detailsDialog" header="View Details" widgetVar="detailsDialogWidget" resizable="true" modal="true" style="min-width:400px; min-height:300px;">
		<p:messages autoUpdate="true" showDetail="true"/>
		<br/><br/>
		<p:outputLabel value="To be completed. Items details will be shown here once this feature is complete" style="font-weight:bold;"/>
		<br/><br/><br/><br/>
		<p:commandButton id="cancelFieldGroupingButton" value="Close"	onclick="PF('detailsDialogWidget').hide();" />
		<br/><br/>
	</p:dialog>
	
	</h:form>
	
	<p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false" closable="false" resizable="false">  
    	<p:graphicImage value="/images/ajaxloadingbar.gif" />  
	</p:dialog>  

</h:body>
</html>